package com.asion.qkan.ui.fragment;


import android.os.Build;
import android.support.annotation.RequiresApi;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;

import com.asion.qkan.R;
import com.asion.qkan.adapter.FindAdapter;
import com.asion.qkan.entry.RecommendEntry;
import com.asion.qkan.ui.contract.FindContract;
import com.asion.qkan.ui.model.FindModel;
import com.asion.qkan.ui.presenter.FindPresenter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;


/**
 * Created by asion on 16-10-12.
 */

public class FindFragment extends BaseFragment{


    @BindView(R.id.find_viewpager)
    ViewPager viewPager;
    @BindView(R.id.find_tablayout)
    TabLayout tabLayout;
    private List<Fragment> list;
    private String [] titles = {"推荐","分类"};


    @Override
    protected int getLayoutResource() {
        return R.layout.find_fragment;
    }

    @Override
    public void initPresenter() {

    }

    @RequiresApi(api = Build.VERSION_CODES.HONEYCOMB)
    @Override
    protected void initView() {
        list = new ArrayList<>();
        list.add(new RecommedFragment());
        list.add(new CategoryFragment());
        viewPager.setAdapter(new FindAdapter(getFragmentManager(),list,titles));
        tabLayout.setupWithViewPager(viewPager);
    }

}
